import request from '@/utils/request';
import type { AxiosPromise } from '@/utils/request';
import type { StampApplicationVO, StampApplicationForm, StampApplicationQuery } from '@/pagesA/api/workflow/stampApplication/types';

/**
 * 查询印章使用审批列表
 * @param query
 * @returns {*}
 */

export const listStampApplication = (query?: StampApplicationQuery): AxiosPromise<StampApplicationVO[]> => {
  return request({
    url: '/workflow/stampApplication/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询印章使用审批详细
 * @param id
 */
export const getStampApplication = (id: string | number): AxiosPromise<StampApplicationVO> => {
  return request({
    url: '/workflow/stampApplication/' + id,
    method: 'get'
  });
};

/**
 * 新增印章使用审批
 * @param data
 */
export const addStampApplication = (data: StampApplicationForm) => {
  return request({
    url: '/workflow/stampApplication',
    method: 'post',
    data: data
  });
};

/**
 * 修改印章使用审批
 * @param data
 */
export const updateStampApplication = (data: StampApplicationForm) => {
  return request({
    url: '/workflow/stampApplication',
    method: 'put',
    data: data
  });
};

/**
 * 删除印章使用审批
 * @param id
 */
export const delStampApplication = (id: string | number | Array<string | number>) => {
  return request({
    url: '/workflow/stampApplication/' + id,
    method: 'delete'
  });
};
